
def sort_insert(li):
    for i in range(1, len(li)):
        temp = li[i]
        j = i-1
        while j>=0 and li[j] >temp:
            li[j+1] = li[j]
            j -= 1
        li[j+1] = temp


li = [3,6,9,0,1,2,7]
sort_insert(li)
print(li)